package com.company.cloud.uba.client;

import com.company.cloud.common.bean.BaseClientResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import com.company.cloud.uba.modules.api.request.SysLogAddBatchRequest;
import com.company.cloud.uba.modules.api.request.SysLogAddRequest;
import com.company.cloud.uba.modules.api.request.UserBrowseAddBatchRequest;
import com.company.cloud.uba.modules.api.request.UserBrowseAddRequest;
import com.company.cloud.uba.modules.api.request.UserBrowseObjLogAddBatchRequest;
import com.company.cloud.uba.modules.api.request.UserBrowseObjLogAddRequest;
import com.company.cloud.uba.modules.api.request.UserLoginLogRequest;
import com.company.cloud.uba.modules.api.service.UbaLogRemoteService;
import com.company.cloud.uba.modules.app.service.UserOpLogService;

@RestController
@Service
public class UbaLogRemoteServiceImpl implements UbaLogRemoteService{
	
	
	@Autowired
	private UserOpLogService userOpLogService;

	@Override
	public BaseClientResult<String> saveSysLogOne(SysLogAddRequest params) {
		try {
			userOpLogService.saveSysLogOne(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveSysLogBatch(SysLogAddBatchRequest params) {
		try {
			userOpLogService.saveSysLogBatch(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveUserLoginLog(UserLoginLogRequest params) {
		try {
			userOpLogService.saveUserLoginLogOne(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveUserBrowseBatch(UserBrowseAddBatchRequest params) {
		try {
			userOpLogService.saveUserBrowseBatch(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveUserBrowseOne(UserBrowseAddRequest params) {
		try {
			userOpLogService.saveUserBrowseOne(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveUserBrowseObjLogBatch(UserBrowseObjLogAddBatchRequest params) {
		try {
			userOpLogService.saveUserBrowseObjLogBatch(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

	@Override
	public BaseClientResult<String> saveUserBrowseObjLogOne(UserBrowseObjLogAddRequest params) {
		try {
			userOpLogService.saveUserBrowseObjLogOne(params);
			return BaseClientResult.success();
		}catch (Exception e){
			return BaseClientResult.error(e);
		}
	}

}
